<?php $total_check_amount=0;?>
<?php $total_check_count=count($paymentCheckss);?>
<table class="datagrid" id="gridPaymentChecks">
  <thead class="datagrid">
    <tr>
      <th style="width:16px;"></th>
      <th style="width:50px;">Check#</th>
      <th style="width:50px;">Date</th>
      <th style="width:50px;">Amount</th>
      <th style="width:16px;"></th>
    </tr>
  </thead>
  <tbody class="datagrid" style="height:100px;">
    <?php foreach($paymentCheckss as $paymentChecks):?>
    <tr>
      <td>
        <?php if($void=='N'):?>
          <a href="#" onclick="return paymentVerifyDeleteCheck('<?php echo $paymentChecks->getPaymentIden()?>','<?php echo $paymentChecks->getCheckIden()?>');">[X]</a>
        <?php endif;?>
      </td>
      <td>
        <a href="#" onclick="alert('<?php echo 'Account# '.$paymentChecks->getAccountNumber() ?>'); return false;"><?php echo $paymentChecks->getBankInitials().'#'.$paymentChecks->getCheckNumber()?></a>
      </td>
      <td><?php echo $paymentChecks->getCheckDate()?></td>
      <td style="text-align:right"><?php echo number_format($paymentChecks->getCheckAmount(),2)?></td>
      <td></td>
    </tr>
    <?php $total_check_amount+=$paymentChecks->getCheckAmount()?>
    <?php endforeach;?>
  </tbody>
  <tfoot class="datagrid">
    <tr>
      <td colspan="3" style="text-align:right;">TOTAL CHECK AMOUNT</td>
      <td style="text-align:right;"><?php echo number_format($total_check_amount,2)?></td>
      <td></td>
    </tr>
  </tfoot>
</table>
<?php if($void=='N'):?>
<hr/>
 <?php echo $message?$message.'<br>':''?>
 <?php 
  echo 
    link_to(
      'Add Check',
      'payment/addCheck?payment_iden='.$payment_iden,
      array(
        'id'=>'linkPaymentAddCheck',
      )
    );
?>

<script language="javascript">
  $(document).ready(
    function(){
      paymentGetGridRowData('<?php echo $payment_iden?>');
      paymentSetupCheckPanel();
    }
  );
</script>
<?php endif;?>